package com.mj.mapper;

import com.mj.entity.Student;
import org.apache.ibatis.annotations.*;
import org.apache.ibatis.mapping.StatementType;

import java.util.List;
import java.util.Map;

public interface StudentMapper {
    public List<Student> queryAll();
    @Delete("delete from student where id = #{id}")
    public int deleteById(int id);
    @Select("select * from student")
    public List<Student> queryTotal();
    @Select("select * from student where name like #{name}")
    public List<Student> queryByName(String n);
    @Select("select count(*) from student")
    public int count();
    @Select("select name,score from student where id = #{id}")
    public Map<String,Object> queryById(int id);
    @Select("select name,score from student where 1=1")
    public List<Map<String,Object>>querySome();
    @Select("Call stud") @Options(statementType = StatementType.CALLABLE)//Option里面是语句类型
    public List<Student> stu();
    @Delete("Call del(#{id})") @Options(statementType = StatementType.CALLABLE)
    public void del(int id);
    @Update("Call upd(#{uid},#{uname})")
    public void update(@Param("uid") int id,@Param("uname") String name);
    @Select("select * from student limit #{start},#{size}")
    public List<Student> ppp(@Param("start") int start,@Param("size") int size);
    @Select("select count(*) from student")
    public int getCount();
}
